Skip to content

[PWGLF] Update MC centrality task - #17601

Merged
romainschotter merged 32 commits into
AliceO2Group:masterfrom
romainschotter:mc-centrality
Aug 26, 2026
Merged

[PWGLF] Update MC centrality task#17601
romainschotter merged 32 commits into
AliceO2Group:masterfrom
romainschotter:mc-centrality

Conversation

@romainschotter

@romainschotter romainschotter commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator
  • extend MC centrality to all available estimators

  • re-write MC centrality assignment using MC multiplicities calculated in the multCentTable.cxx

  • factorize MC centrality task into a class module in order to be usable when running over original data AND derived data (assuming that the derived data contains a table with all of the following getters: multMCFT0A(), multMCFT0C(), multMCFV0A(), multMCFDDA(), multMCFDDC(), multMCNParticlesEta08(), multMCNParticlesEta05()). This allows to NOT store the MC centrality in derived data but simply to store the MC multiplicity and later calculate the MC centrality on the fly.

  • add auto-detection features

  • allow MC centrality calibration to be extracted on the fly in order to find the MC centrality bins ensuring the best matching between the recoed multiplicity in data and MC

  • provide an alternative MC centrality calibration mode: instead of extracting the MC centrality calibration going from low-multiplicity to high-multiplicity collisions, start from the high-multiplicity collisions (where the difference in MC multiplicities is bigger from one class to the next) to the low-multiplicity collisions. This ensures a more stable extraction of the MC centrality calibration and an overall better matching of the recoed multiplicity in data and MC as show below

image
  • provide an alternative assignment of the MC centrality, inspired from the approach in the analyses in light- and heavy-ion collisions. In OO and Pb-Pb collisions, the correlations between centrality and a generated quantity (typically MC multiplicity in |eta|< 0.5) is used. This allows to extract the conditional probability P(MC multiplicity|centrality) (see left figure), which can be used to assign statistically a centrality value to generated collisions by multiplying the any quantity as a function of the MC multiplicity by the corresponding probability distribution within the considered centrality bin. Another approach to assign a centrality value on a candidate-by-candidate basis is to extract the conditional probability P(centrality| MC multiplicity) (see right figure) and, for a given MC multiplicity, sample the corresponding probability distribution to extract a centrality value. The latter approach has now been implemented in the MC centrality task and can be used by turning on assignCentralityPerCandidate.

NOTE1: this latter approach assumes that there is already a good matching in the recoed multiplicity in data and MC in all centrality bins.
NOTE2: the latter approach has the advantage that it works for any centrality binning, which is not the case for the other approaches in the MC centrality task.

image
  • update derivedlambdakzeroanalysis.cxx in order to use the MC centrality (for testing)

@ddobrigk @njacazio @ercolessi for your information

@github-actions github-actions Bot changed the title Update MC centrality task [PWGLF] Update MC centrality task Aug 25, 2026
@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown

O2 linter results: ❌ 179 errors, ⚠️ 69 warnings, 🔕 0 disabled

@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/staging for 7648416 at 2026-08-26 02:50:

## sw/BUILD/O2Physics-latest/log
c++: fatal error: Killed signal terminated program cc1plus
c++: fatal error: Killed signal terminated program cc1plus
c++: fatal error: Killed signal terminated program cc1plus
ninja: build stopped: subcommand failed.

Full log here.

@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for 7648416 at 2026-08-26 08:34:

## sw/BUILD/O2Physics-code-check-latest/log
--
========== List of issues found ==========
++ echo 'Found 27 errors and 196 warnings.'
Found 27 errors and 196 warnings.
++ [[ 27 -gt 0 ]]
++ cat /sw/BUILD/8d0509c6128a3727b995b889fb9f9d4c1ddef571/O2Physics-code-check/errors.txt
PWGLF/TableProducer/Common/mcCentrality.cxx:41:8: error: constructor does not initialize these fields: ccdb [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx:82:9: error: function-like macro 'bitset' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage,-warnings-as-errors]
PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx:83:9: error: function-like macro 'bitcheck' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage,-warnings-as-errors]
PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx:85:8: error: constructor does not initialize these fields: pdg [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx:182:56: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors]
PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx:291:39: error: the parameter 'collision' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]
PWGLF/TableProducer/Strangeness/strangenessMcCentrality.cxx:37:8: error: constructor does not initialize these fields: ccdb [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx:91:9: error: function-like macro 'BITSET' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage,-warnings-as-errors]
PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx:92:9: error: function-like macro 'BITCHECK' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage,-warnings-as-errors]
PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx:103:8: error: constructor does not initialize these fields: isRun3, ccdb, mRunNumber, magField, maskTopological, maskTopoNoV0Radius, maskTopoNoDCANegToPV, maskTopoNoDCAPosToPV, maskTopoNoCosPA, maskTopoNoDCAV0Dau, maskTrackProperties, maskK0ShortSpecific, maskLambdaSpecific, maskAntiLambdaSpecific, maskSelectionK0Short, maskSelectionLambda, maskSelectionAntiLambda, secondaryMaskSelectionLambda, secondaryMaskSelectionAntiLambda [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx:203:67: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors]
PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx:1349:28: error: the parameter 'collision' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]
PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx:1410:44: error: the parameter 'v0' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]
PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx:1410:59: error: the parameter 'collision' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]
PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx:1673:37: error: the parameter 'v0' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]
PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx:1856:29: error: the parameter 'v0' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]
PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx:2259:46: error: the parameter #1 is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]
PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx:2282:31: error: the parameter 'v0' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]
PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx:2336:35: error: the parameter 'collision' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]
PWGLF/Utils/mcCentralityModule.h:53:1: error: using declarations in the global namespace in headers are prohibited [google-global-names-in-headers,-warnings-as-errors]
PWGLF/Utils/mcCentralityModule.h:54:1: error: using declarations in the global namespace in headers are prohibited [google-global-names-in-headers,-warnings-as-errors]
PWGLF/Utils/mcCentralityModule.h:55:1: error: using declarations in the global namespace in headers are prohibited [google-global-names-in-headers,-warnings-as-errors]
PWGLF/Utils/mcCentralityModule.h:123:80: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors]
PWGLF/Utils/mcCentralityModule.h:385:17: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]
PWGLF/Utils/mcCentralityModule.h:402:32: error: the parameter 'estimator' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]
PWGLF/Utils/mcCentralityModule.h:455:28: error: narrowing conversion from 'Double_t' (aka 'double') to 'int' [bugprone-narrowing-conversions,-warnings-as-errors]
PWGLF/Utils/mcCentralityModule.h:529:28: error: narrowing conversion from 'Double_t' (aka 'double') to 'int' [bugprone-narrowing-conversions,-warnings-as-errors]
++ [[ 196 -gt 0 ]]
++ cat /sw/BUILD/8d0509c6128a3727b995b889fb9f9d4c1ddef571/O2Physics-code-check/warnings.txt
PWGLF/DataModel/LFStrangenessTables.h:80:72: warning: redundant boolean literal in ternary expression result [readability-simplify-boolean-expr]
PWGLF/DataModel/LFStrangenessTables.h:694:52: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
PWGLF/DataModel/LFStrangenessTables.h:695:52: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
PWGLF/DataModel/LFStrangenessTables.h:696:48: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
PWGLF/DataModel/LFStrangenessTables.h:697:48: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
PWGLF/DataModel/LFStrangenessTables.h:698:52: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
PWGLF/DataModel/LFStrangenessTables.h:699:52: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
PWGLF/DataModel/LFStrangenessTables.h:1337:37: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
PWGLF/DataModel/LFStrangenessTables.h:1341:37: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
PWGLF/DataModel/LFStrangenessTables.h:1344:50: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
PWGLF/DataModel/LFStrangenessTables.h:1345:54: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
PWGLF/DataModel/LFStrangenessTables.h:1346:66: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
PWGLF/DataModel/LFStrangenessTables.h:1347:66: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
[0 more errors; see full log]

Full log here.

@romainschotter
romainschotter marked this pull request as draft August 26, 2026 07:45
auto-merge was automatically disabled August 26, 2026 07:45

Pull request was converted to draft

Please consider the following formatting changes to AliceO2Group#17601
@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/o2 for cb93b45 at 2026-08-26 11:49:

## sw/BUILD/O2Physics-latest/log
c++: fatal error: Killed signal terminated program cc1plus
c++: fatal error: Killed signal terminated program cc1plus
c++: fatal error: Killed signal terminated program cc1plus
ninja: build stopped: subcommand failed.

Full log here.

@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for 6a9a47d at 2026-08-26 14:39:

## sw/BUILD/O2Physics-latest/log
c++: fatal error: Killed signal terminated program cc1plus
c++: fatal error: Killed signal terminated program cc1plus
c++: fatal error: Killed signal terminated program cc1plus
ninja: build stopped: subcommand failed.

Full log here.

@romainschotter
romainschotter merged commit b03c501 into AliceO2Group:master Aug 26, 2026
12 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants